function checkMobile(s) {
    var regu = /^[1][3|8|4|5|7][0-9]{9}$/;
    var re = new RegExp(regu);
    if (re.test(s)) {
        return true;
    } else {
        return false;
    }
}
function tusi(txt, fun) {
    $('.tusi').remove();
    var div = $('<div style="background-image: url(style/tusi.png);max-width: 85%;min-height: 77px;min-width: 270px;position: absolute;left: -1000px;top: -1000px;text-align: center;border-radius:10px;"><span style="color: #ffffff;line-height: 77px;font-size: 23px;">' + txt + '</span></div>');
    $('body').append(div);
    div.css('zIndex', 9999999);
    div.css('left', parseInt(($(window).width() - div.width()) / 2));
    var top = parseInt($(window).scrollTop() + ($(window).height() - div.height()) / 2);
    div.css('top', top);
    setTimeout(function() {
        div.remove();
        if (fun) {
            fun();
        }
    }, 2000);
}
function loading(txt) {
    if (txt === false) {
        $('.qp_lodediv').remove();
    } else {
        $('.qp_lodediv').remove();
        var div = $('<div class="qp_lodediv" style="background: url("style/loadb.png");\n\
width: 269px;height: 107px;position: absolute;left: -1000px;top: -1000px;text-align: center;">\n\
<span style="color: #ffffff;line-height: 107px;font-size: 23px; white-space: nowrap;">\n\
&nbsp;&nbsp;&nbsp;<img src="style/load.gif" style="vertical-align: middle;"/>&nbsp;&nbsp;' + txt + '</span></div>');
        $('body').append(div);
        div.css('zIndex', 9999999);
        div.css('left', parseInt(($(window).width() - div.width()) / 2));
        var top = parseInt($(window).scrollTop() + ($(window).height() - div.height()) / 2);
        div.css('top', top);
    }
}
/*转换时间，计算差值*/
function comptime(beginTime, endTime) {
    var secondNum = parseInt((endTime - beginTime * 1000) / 1000);//计算时间戳差值
    if (secondNum >= 0 && secondNum < 60) {
        return secondNum + '秒前';
    }
    else if (secondNum >= 60 && secondNum < 3600) {
        var nTime = parseInt(secondNum / 60);
        return nTime + '分钟前';
    }
    else if (secondNum >= 3600 && secondNum < 3600 * 24) {
        var nTime = parseInt(secondNum / 3600);
        return nTime + '小时前';
    }
    else {
        var nTime = parseInt(secondNum / 86400);
        return nTime + '天前';
    }
}